package com.example.demo.controller;

import com.example.demo.entity.GoodsEntry;
import com.example.demo.entity.ResponseResult;
import com.example.demo.service.GoodsEntryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/goodsEntry")
@Api(tags = "入库单接口")
public class GoodsEntryController {

    @Resource
    private GoodsEntryService goodsEntryService;


    @ApiOperation(value = "查询全部入库单")
    @GetMapping
    public ResponseResult getList(){
        return goodsEntryService.getList();
    }

    @ApiOperation(value = "录入入库单")
    @PostMapping
    public ResponseResult saveGoodsEntry(@RequestBody GoodsEntry goodsEntry){
        return goodsEntryService.saveGoodsEntry(goodsEntry);
    }
}
